//
//  main.cpp
//  VideoParse
//
//  Created by xiaerfei on 2020/2/10.
//  Copyright © 2020 erfeixia. All rights reserved.
//

#include <iostream>
#include "File.hpp"
#include "AVIOContext.hpp"
#include "FLVDemuxer.hpp"
#include "AVFormatContext.hpp"


int main(int argc, const char * argv[]) {
    char *p = (char *)"/Users/xiaerfei/Documents/ffmpegDemo/res/cuc_ieschool.flv";
    AVFormatContext *avFormatContext = new AVFormatContext();
    avFormatContext->open_input(p, NULL, NULL);
    avFormatContext->find_stream_info(NULL);
    
    avFormatContext->read_header();
    avFormatContext->read_packet(NULL);
    
    
    
    
    
//    char *signature = new char(3);
//    context->read_packet((unsigned char *)signature, 3);
//    std::cout << signature << std::endl;
//    int version = context->avio_r8();
//    std::cout << version << std::endl;
//
//    int flag = context->avio_r8();
//    std::cout << "audio: "<< ((flag >> 2) & 0x01) <<" video: "<< (flag & 0x01) << std::endl;
//
//    int head_size = context->avio_rb32();
//    std::cout << head_size << std::endl;
    
    return 0;
}
